package org.scau.studentevaluation.client;

import org.scau.studentevaluation.entity.response.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 通过 Feign 访问AttendedStudentList微服务
 * @Author: x1aolone
 * @Date: 2020/8/27 16:20
 */
@FeignClient(value = "eureka-client-attendedstudentlist",
        fallback = AttendedStudentListClientHystrix.class)
public interface AttendedStudentListClient {

    /**
     * 【测试通过】
     * 通过feign调用AttendedStudentList模块中获取学生的活动Id的方法
     * 通过studentId从attendedstudentlist中获取actId
     * @param studentId
     * @return
     */
    @RequestMapping(value = "/attendedstudentlist/getActIDs/{studentId}",
            method = RequestMethod.GET)
    Result<List<Long>> getActIds(@RequestParam("studentId")Long studentId);


    /**
     * 【测试通过】
     * 通过feign调用AttendedStudentList模块中的方法
     * 通过college从attendedstudentlist中获取actId列表
     * @param college
     * @return
     */
    @RequestMapping(value = "/attendedstudentlist/getActIDsByCollege/{college}",
            method = RequestMethod.GET)
    Result<List<Long>> getActIds(@RequestParam("college")String college);

}
